package com.ruiyian.bridge.project.service.impl;

import com.ruiyian.bridge.project.domain.DeviceTypeItem;
import com.ruiyian.bridge.project.mapper.DeviceTypeItemMapper;
import com.ruiyian.bridge.project.service.DeviceTypeItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 传感器监测类型Service业务层处理
 *
 * @author ruiyian
 * @date 2022-01-21
 */
@Service
public class DeviceTypeItemServiceImpl implements DeviceTypeItemService
{
    @Autowired
    private DeviceTypeItemMapper deviceTypeItemMapper;

    /**
     *
     * @param deviceTypeItem
     * @return 传感器监测类型item和unit
     */
    public List<DeviceTypeItem> selectTSensorTypeItemListBySensorType(DeviceTypeItem deviceTypeItem) {
        return deviceTypeItemMapper.selectTSensorTypeItemListBySensorType(deviceTypeItem);
    }
    /**
     * 查询传感器监测类型
     *
     * @param id 传感器监测类型主键
     * @return 传感器监测类型
     */
    @Override
    public DeviceTypeItem selectTSensorTypeItemById(Integer id)
    {
        return deviceTypeItemMapper.selectTSensorTypeItemById(id);
    }

    /**
     * 查询传感器监测类型列表
     *
     * @param deviceTypeItem 传感器监测类型
     * @return 传感器监测类型
     */
    @Override
    public List<DeviceTypeItem> selectTSensorTypeItemList(DeviceTypeItem deviceTypeItem)
    {
        return deviceTypeItemMapper.selectTSensorTypeItemList(deviceTypeItem);
    }

    /**
     * 新增传感器监测类型
     *
     * @param deviceTypeItem 传感器监测类型
     * @return 结果
     */
    @Override
    public int insertTSensorTypeItem(DeviceTypeItem deviceTypeItem)
    {
        return deviceTypeItemMapper.insertTSensorTypeItem(deviceTypeItem);
    }

    /**
     * 修改传感器监测类型
     *
     * @param deviceTypeItem 传感器监测类型
     * @return 结果
     */
    @Override
    public int updateTSensorTypeItem(DeviceTypeItem deviceTypeItem)
    {
        return deviceTypeItemMapper.updateTSensorTypeItem(deviceTypeItem);
    }

    /**
     * 批量删除传感器监测类型
     *
     * @param ids 需要删除的传感器监测类型主键
     * @return 结果
     */
    @Override
    public int deleteTSensorTypeItemByIds(Integer[] ids)
    {
        return deviceTypeItemMapper.deleteTSensorTypeItemByIds(ids);
    }

    /**
     * 删除传感器监测类型信息
     *
     * @param id 传感器监测类型主键
     * @return 结果
     */
    @Override
    public int deleteTSensorTypeItemById(Integer id)
    {
        return deviceTypeItemMapper.deleteTSensorTypeItemById(id);
    }
}
